Skip to content

Add German cache-coherence protocol example (Murphi > TLA+)#214

Merged
lemmy merged 12 commits into
tlaplus:masterfrom
lemmy:mku-german
Jul 20, 2026
Merged

Add German cache-coherence protocol example (Murphi > TLA+)#214
lemmy merged 12 commits into
tlaplus:masterfrom
lemmy:mku-german

Conversation

@lemmy

@lemmy lemmy commented Jul 16, 2026

Copy link
Copy Markdown
Member

Adds an example translated from Divjyot Sethi's Murphi sources, with three refinement levels:

  • GermanCoherence — control-only coherence / mutual exclusion
  • German — CMP-style abstraction (concrete nodes + abstract Other + ABS_* rules)
  • GermanWithMutex — data-carrying model with DataProp, invariants, noninterference lemmas, and liveness under fairness

Each spec ships with TLC and Apalache models/configs following existing repo conventions.

lemmy and others added 3 commits July 16, 2026 09:56
A new specifications/GermanProtocol directory translating the German
directory-based cache-coherence protocol from the Murphi sources in
Divjyot Sethi's ProtocolDeadlockFiles repository (provenance: German ->
Chou/Mannava/Park FMCAD 2004 -> Sethi/Talupur/Malik ATVA 2014). The TLA+
was synthesized by Opus 4.8 under supervision; see the directory README.md
for the full attribution chain.

Three levels of refinement, each a standalone module:
  - GermanCoherence: control-only model, coherence/mutual exclusion only.
  - German: the CMP-style parameterized abstraction (concrete nodes plus
    a single abstract "Other" environment node and the ABS_* rules).
  - GermanWithMutex: the data-carrying refinement, adding data-integrity
    (DataProp), the structural well-formedness invariants, and the
    Lemma_1/Lemma_2 noninterference lemmas, plus liveness under fairness.

Tooling added for each spec, following the conventions already used in
the repo (INSTANCE-based Apalache wrappers; MC* TLC drivers):
  - AP{GermanCoherence,German,GermanWithMutex}.tla/.cfg apply Apalache
    type annotations via INSTANCE so the specs stay tool-agnostic; nodes
    and data are uninterpreted types so the NODE \cup {Other, NoNode}
    unions type-check. Safety invariants only (no liveness).
  - MC{GermanCoherence,German,GermanWithMutex}.tla/.cfg use the smallest
    meaningful constants -- two nodes (the minimum for non-vacuous mutual
    exclusion) and, for GermanWithMutex, two data values (so writes are
    distinguishable) -- with Permutations symmetry reduction.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
Explain that the \A j conjunct in the ABS_RecvInvAck action's enabling
condition is the operational mutual-exclusion noninterference lemma
(Chou/Mannava/Park FMCAD 2004; Sethi/Talupur/Malik arXiv:1407.7468):
germanWithMutex.m conjoins it, germanNoMutex.m deliberately omits it.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
These specs were translated from Murphi, whose rules cannot express
intra-action nondeterminism, so a single nondeterministic choice must be
split across separate rules. TLA+ expresses that choice directly with
existential quantification and disjunction, so collapse each flavour-split
pair into one action. This removes the duplication the Murphi encoding
forced without changing the specs' behaviors.

Verified equivalence-preserving with TLAPS: an auxiliary module per spec
keeps the old split actions as _o operators, and TLAPS proves
Next <=> Next_o (one BY DEF biconditional lemma per merged action).

```tla
(* Per-action equivalences (divide and conquer). *)

LEMMA SendReqEquiv ==
    ASSUME NEW i \in NODE
    PROVE  SendReq(i) <=> (SendReqS_o(i) \/ SendReqE_o(i))
BY DEF SendReq, SendReqS_o, SendReqE_o

LEMMA RecvReqEquiv ==
    ASSUME NEW i \in NODE
    PROVE  RecvReq(i) <=> (RecvReqS_o(i) \/ RecvReqE_o(i))
BY DEF RecvReq, RecvReqS_o, RecvReqE_o

LEMMA SendGntEquiv ==
    ASSUME NEW i \in NODE
    PROVE  SendGnt(i) <=> (SendGntS_o(i) \/ SendGntE_o(i))
BY DEF SendGnt, SendGntS_o, SendGntE_o

LEMMA RecvGntEquiv ==
    ASSUME NEW i \in NODE
    PROVE  RecvGnt(i) <=> (RecvGntS_o(i) \/ RecvGntE_o(i))
BY DEF RecvGnt, RecvGntS_o, RecvGntE_o

-------------------------------------------------------------------------------
(* Coarse-grained equivalence at the level of Next. *)

THEOREM NextEquiv == Next <=> Next_o
BY SendReqEquiv, RecvReqEquiv, SendGntEquiv, RecvGntEquiv
   DEF Next, Next_o
```

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>

This comment was marked as resolved.

@muenchnerkindl muenchnerkindl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A nice addition to the examples repository!

Comment thread specifications/GermanProtocol/German.tla Outdated
Comment thread specifications/GermanProtocol/German.tla Outdated
Comment thread specifications/GermanProtocol/German.tla Outdated
Comment thread specifications/GermanProtocol/German.tla Outdated
Comment thread specifications/GermanProtocol/GermanCMPWithMutex.tla
Comment thread specifications/GermanProtocol/GermanWithMutex.tla Outdated
Comment thread specifications/GermanProtocol/GermanWithMutex.tla Outdated
Comment thread specifications/GermanProtocol/MCGermanWithMutex.tla Outdated
Comment thread specifications/GermanProtocol/GermanWithMutex.tla Outdated
Comment thread specifications/GermanProtocol/APGerman.tla Outdated
lemmy added 2 commits July 20, 2026 13:49
Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
@lemmy lemmy self-assigned this Jul 20, 2026
lemmy added 7 commits July 20, 2026 14:47
Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
Fold ChannelWellFormed into TypeOK and restrict each channel and curCmd to reachable command values.

Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
Use consistent Data, Control, and CMPWithMutex names across the
specifications, TLC and Apalache models, manifest, and documentation.

Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
@lemmy
lemmy merged commit d9456a2 into tlaplus:master Jul 20, 2026
9 of 13 checks passed
@lemmy
lemmy deleted the mku-german branch July 20, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants